//
//  HSMediator.h
//  ObjcDemo
//
//  Created by fan on 2021/10/15.
//

#import <UIKit/UIKit.h>
#import "HSTargetAction.h"
#import "HSParameters.h"

NS_ASSUME_NONNULL_BEGIN

@interface HSMediator : NSObject

+ (instancetype _Nonnull)sharedInstance;

/**
 * 远程App调用入口
 * scheme://[target]/[action]?[params]
 * url sample:
 * aaa://targetA/actionB?id=1234
 */
- (id _Nullable)dispatchWithUrl:(NSURL *)url;


/// 通过HSTargetAction调用模块，默认不缓存Target
/// @param targetAction HSTargetAction对象
- (id _Nullable)dispatch:(HSTargetAction *)targetAction;

/// 通过HSTargetAction调用模块
/// @param targetAction HSTargetAction对象
/// @param shouldCacheTarget 是否缓存Target对象
- (id _Nullable)dispatch:(HSTargetAction *)targetAction shouldCacheTarget:(BOOL)shouldCacheTarget;

@end

NS_ASSUME_NONNULL_END
